This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
RE: Unique Field Lookup Issue ~Umberto Nongeroson 14.Jan.04 03:09 AM a Web browser Domino Designer All ReleasesAll Platforms
It's nice that you're thinking about checking uniqueness even if the document is not new, but this formula isn't going to do it either. If the field is editable when the document is not new (and I can think of no other reason to check for uniqueness in that case if not!) there's no way to know whether the one document you find with your lookup, is this document or some other. If it's some other, you do want to display an error, but in either case the matching count is 1.
Furthermore, it's a big waste of time to do the lookup at the beginning of the formula. First check @IsDocBeingSaved, for efficiency.
That said, there's basically nothing wrong with the formula in the original post, per se. It doesn't handle the case of subsequent saves, but I choose to believe Karen's taking care of that by making the field non-editable on subsequent opens. I suspect the @DbLookup is always returning an error because the design of the view is wrong for doing that particular lookup. The view has to exist, for instance, and must sorted by the field whose value you're searching for.
If you're not sure what the problem is, you could put a button on your form that just does @StatusBar(@Text(@DbLookup("":"NoCache"; ""; "All Reqs"; RequestNo; "RequestNo")))
BTW the recognized indication for "the current database" is "", not "":"". The latter will work, but why use more complex expressions than you need?